// function identityNumber(arg: number|string): number|string {
//     return arg;
// }

function identityNumber<T>(arg: T): T {
    let r = arg;
    return r;
}

console.log(identityNumber("123"))
console.log(identityNumber<number>(100))

function identityNumber2<T>(arg: T[]): T[] {
    let r = arg;
    return r;
}

function identityNumber3<T>(arg: Array<T>): Array<T> {
    let r = arg;
    return r;
}

console.log(identityNumber2([1, 2, 3]))
console.log(identityNumber2<number>([1, 2, 3]))
console.log(identityNumber3<string>(["1", "2", "3"]))

function identityNumber4<U, V>(arg1: U, arg2: V, arg: U, arg4: V): U | V {
    let r1 = arg1;
    let r2 = arg2;
    return r1;
}

// identityNumber4(10, "123")
// identityNumber4(10, 123)
identityNumber4(10, "123", 100, "100")
